package com.besttone.bean;

import java.util.ArrayList;
import java.util.List;

import com.besttone.util.JsonUtil;

public class IntergrationInfo {
    public String template_code;
    public String coupon_code;
    public String reserve_code;
    public Long sms_count;// 短信条数
    public Long shortlink_count;// 短链接访问数
    public Long msg_count;// 优惠券数/预约数

    public Long getSms_count() {
	return sms_count;
    }

    public void setSms_count(Long sms_count) {
	this.sms_count = sms_count;
    }

    public Long getShortlink_count() {
	return shortlink_count;
    }

    public void setShortlink_count(Long shortlink_count) {
	this.shortlink_count = shortlink_count;
    }

    public Long getMsg_count() {
	return msg_count;
    }

    public void setMsg_count(Long msg_count) {
	this.msg_count = msg_count;
    }

    public String getTemplate_code() {
	return template_code;
    }

    public void setTemplate_code(String template_code) {
	this.template_code = template_code;
    }

    public String getCoupon_code() {
	return coupon_code;
    }

    public void setCoupon_code(String coupon_code) {
	this.coupon_code = coupon_code;
    }

    public String getReserve_code() {
	return reserve_code;
    }

    public void setReserve_code(String reserve_code) {
	this.reserve_code = reserve_code;
    }

    public static long bytes2Long(byte[] byteNum) {
	long num = 0;
	for (int ix = 0; ix < 8; ++ix) {
	    num <<= 8;
	    num |= (byteNum[ix] & 0xff);
	}
	return num;
    }

    public static void main(String[] args) {
	byte[] bytes = { 0, 0, 0, 0, 0, 0, 0, 5 };
	System.out.println(bytes2Long(bytes));
	;
	IntergrationInfo info = new IntergrationInfo();
	info.setCoupon_code("20160828124004946002");
	info.setTemplate_code("20160824183034407027");
	info.setReserve_code("20160905152215252113");
	List<IntergrationInfo> infoList = new ArrayList<IntergrationInfo>();
	infoList.add(info);
	String ss = JsonUtil.ObjectToJsonString(infoList);
	System.out.println(ss);
    }
}
